package iet.jxufe.cn.android.productanti_counterfeitingtraceabilitysystem.fragment.producerFragment;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

public class FragmentProducerStateAdapter extends FragmentStateAdapter {

    public FragmentProducerStateAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        if (position == 0) {
            return null;
        } else if (position == 1) {
            return null;    // 待定
        } else if (position == 2) {
            return new FragmentProfile();
        }
        return null; // 默认Fragment
    }

    @Override
    public int getItemCount() {
        return 3; // Fragment数量
    }
}
